import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class A007PrimeDetermine {
	public static boolean primeDetermine(int n) {
		if(n == 1)
			{ return false; }
		else if(n == 2 || n ==3)
			{ return true; }
		else if(n % 2 == 0)
			{ return false; }
		else {
			int end = (int)Math.pow(n, 0.5);
			for(int i = 3; i <= end; i += 2) {
				if(n % i == 0)
					{ return false; }
			}
			return true;
		}
	}
	public static void main(String args[]) throws IOException {
		int[] primes;
		do {
			primes = new int [46341];
			primes[0] = 2;
			int count = 1;
			for(int i = 1; i <= 46341; i += 2) {
				if(primeDetermine(i)) {
					primes[count] = i;
					count++;
				 }
			}
			primes = java.util.Arrays.copyOf(primes, count);
		} while(false);

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String input;
		StringBuffer output = new StringBuffer();
		int n;
		boolean primesOX = false;

		while((input = (br.readLine())) != null) {
			n  = Integer.parseInt(input);
			
			if(((n % 2) == 0 && n != 2)) {
				primesOX = false;
			} else {
				if(n <= primes[primes.length - 1]) {
//					primesOX = primeDetermine(n); // same result
					primesOX = false;
					
					for(int i = 0; i < primes.length; i++) {
						if(n == primes[i]) {
							primesOX = true;
							break;
						}
					}
				} else {
					primesOX = true;
					
					for(int i = 0; i < primes.length; i++) {
						if((n % primes[i]) == 0) {
							primesOX = false;
							break;
						}
					}
				}
			}
			
			if(primesOX) {
				output.append("質數" + "\n");
			} else {
				output.append("非質數" + "\n");
			}
		}
		
		output.setLength(output.length() - 1);
		System.out.println(output.toString());
	}
}